﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trasitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="~/aa/vue/dist/vue.js"></script>
    <script src="~/aa/element-ui/lib/index.js"></script>
    <link href="~/aa/element-ui/lib/theme-chalk/index.css" rel="stylesheet" />
    <script src="~/aa/axios/dist/axios.js"></script>
    <link href="~/css/table.css" rel="stylesheet" />
    <script type="text/javascript"
            src="../../javascript/jquery-1.7.2.js">
    </script>
    <link rel="stylesheet" href="../../css/table.css" type="text/css" />
    <script type="text/javascript" src="../../javascript/comm/comm.js"></script>
    <title>无标题文档</title>
    <STYLE type="text/css">
        td {
            text-align: center
        }
    </STYLE>
    <style type="text/css">
        body {
            background: rgb(253,244,227);
        }

        .TD_STYLE1 {
            background: #E6DDCE;
            /* color:white; */
        }

        .TD_STYLE2 {
            background: rgb(253,244,227);
        }

        .INPUT_STYLE2 {
            background: rgb(253,244,227);
        }
    </style>
</head>

<body>
    <div id="query">
        <table width="100%">
            <tr>
                <td colspan="2" style="text-align: left">
                    <font color="black">
                        您正在做的业务是：人力资源--薪酬标准管理--薪酬发放登记(负责人控制)
                    </font>
                </td>
            </tr>
        </table>
        <br>
        
        <table width="100%" border="1" cellpadding=0 cellspacing=1
               bordercolorlight=#848284 bordercolordark=#eeeeee
               class="TABLE_STYLE1">
            <template>
                <el-table :data="table"
                          style="width: 100%">
                    <el-table-column prop="hufId"
                                     label="序号"
                                     width="180">
                    </el-table-column>
                    <el-table-column prop="firstKindName"
                                     label="I级机构"
                                     width="180">
                    </el-table-column>
                    <el-table-column prop="secondKindName"
                                     v-if="tableVisible"
                                     label="Ⅱ级机构"
                                     width="180">
                    </el-table-column>
                    <el-table-column prop="thirdKindName"
                                     label="Ⅲ级机构"
                                     v-if="tableVisible2"
                                     width="180">
                    </el-table-column>
                    <el-table-column prop="salaryStandardId"
                                     label="薪酬标准编号"
                                     v-if="false"
                                     width="180">
                    </el-table-column>
                    <el-table-column prop="salarySum"
                                     label="基本薪酬总额"
                                     width="180">
                    </el-table-column>

                    <el-table-column label="登记" width="180">

                        <template slot-scope="scope">
                            <span v-if="scope.row.checkStatus==0" >
                                <el-button type="text" v-on:click="dj(scope)">登记</el-button>
                                </span>
                            <span v-if="scope.row.checkStatus==1" :disabled="true">
                                <el-button type="text" >已结</el-button>
                                </span>
                        </template>
                    </el-table-column>
                </el-table>
            </template>

        </table>
        <p>

            &nbsp;
        </p>
    </div>
    <script type="text/javascript">
        var vm = new Vue({
            el: "#query",
            data: {
                table: [],
                where: "",
                tableVisible: false,
                tableVisible2: false,
                tableVisible3: false
            },
            methods: {
                handleSubmit() {


                    // 发送异步请求到服务器
                    axios.get('/SG/GetQuery', {
                        params: {
                            selectedValue: this.where
                        }
                    })
                        .then(response => {
                            // 请求成功，更新页面数据
                            this.table = response.data;
                            for (const a of this.table) {
                                if (a.secondKindId) {
                                    this.tableVisible = true;
                                    break;
                                }
                                if (a.thirdKindId) {
                                    this.tableVisible2 = true;
                                    break;
                                }
                            }
                            console.log(response.data);
                            console.log("table:" + response.data);
                        })
                        .catch(error => {
                            // 请求失败，处理错误
                            console.error(error);
                        });
                },
                editItem: function (Id) {
                    console.log(Id);
                    window.location.href = '/salary_grant/Add/' + Id; // 跳转到修改页面
                },
                dj(scope) {
                    console.log("set:"+scope.row.salaryStandardId);
                    sessionStorage.setItem("SalaryStandardId", scope.row.salaryStandardId);
                    sessionStorage.setItem("SalarySum", scope.row.salarySum);
                    sessionStorage.setItem("FirstKindId", scope.row.firstKindId);
                    sessionStorage.setItem("FirstKindName", scope.row.firstKindName);
                    sessionStorage.setItem("SecondKindId", scope.row.secondKindId);
                    sessionStorage.setItem("SecondKindName", scope.row.secondKindName);
                    sessionStorage.setItem("ThirdKindId", scope.row.thirdKindId);
                    sessionStorage.setItem("ThirdKindName", scope.row.thirdKindName);

                    window.location.href = '/SG/Insert';
                },
            }
            , mounted: function () {
                this.where = sessionStorage.getItem("selectedValue");
                this.handleSubmit();
            }
        });
    </script>
</body>
</html>